// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'
import App from './App'
import router from './router'

import $ from 'jquery'

import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'
Vue.use(ElementUI)

import axios from 'axios'
import "babel-polyfill"
//异步及兼容

// import MockAdapter from 'axios-mock-adapter'
// import Mock from './data/user.js'
// Mock.init()

import Vuex from 'vuex'
import store from './vuex/store'
Vue.use(Vuex)

import VueAMap from 'vue-amap'
Vue.use(VueAMap);
VueAMap.initAMapApiLoader({
  key: '672c13dda9a2faed1f86b5a43eeb891b',
  plugin: ['Geocoder'],
  v: '1.4.4'
});
//高德地图的vueAPI

import moment from 'moment'
//时间转换

import Lockr from 'lockr'
//localStorage

import  VueQuillEditor from 'vue-quill-editor'
Vue.use(VueQuillEditor)
//富文本输入框

axios.defaults.headers={
  'Accept':'application/json', 
  'Accept-Language':'zh-CN,zh;q=0.9',
  'Content-Type':'application/x-www-form-urlencoded; charset=UTF-8'
}
// axios.defaults.baseURL = HOST
axios.defaults.baseURL = HOST
// axios.defaults.baseURL = HOST
axios.defaults.timeout = 1000 * 15
//axios的基本设置,content-type可以设置为application/json,但有时候会出奇怪的问题
//所以设置为x-www-form-urlencoded,异步时要把params转为一个URLSearchParams

window.router = router
// window.HOST = HOST
window.HOST = HOST
// window.HOST = HOST
window.axios = axios
window.Lockr = Lockr
window.isDetailBack=true
window.qiniuHost = QINIUYUNHOST
//七牛云物理路径
Vue.config.productionTip = false
//阻止启动生产消息

router.beforeEach(function(to, from, next){
  if(from.path=='/Detial'){
    isDetailBack=false;
  }
  next()
})


new Vue({
  el: '#app',
  router,
  store,
  template: '<App/>',
  components: { App }
})
